package conchmusic.conchmusicclient.util;

import java.util.Comparator;

import conchmusic.conchmusicclient.pojo.SortMusic;

public class PinyinComparator implements Comparator<SortMusic> {

    public int compare(SortMusic o1, SortMusic o2) {
        //这里主要是用来对ListView里面的数据根据ABCDEFG...来排序

        if ("#".equals(o1.getSortLetters())
                &&! "#".equals(o2.getSortLetters())) {
            return -1;
        } else if (!"#".equals(o1.getSortLetters())
                &&"#" .equals(o2.getSortLetters())) {
            return 1;
        }else{
            return o1.getSortLetters().compareTo(o2.getSortLetters());
        }
    }
}
